package com.klikmee.sms.chat.web.dao;

import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import com.klikmee.sms.services.chat.model.BulkGroup;

public class BulkGroupDAO extends AbstractDAO<BulkGroup> {

	public BulkGroupDAO() {
		super(BulkGroup.class);
	}
	
	@PersistenceContext
	private EntityManager em;

	@SuppressWarnings("unchecked")
	public List<BulkGroup> selectAll() {
		List<BulkGroup> groups = null;
		try {
			groups = (List<BulkGroup>) em.createNamedQuery("BulkGroup.findAll").getResultList();
		} catch (NoResultException e) {

		}

		return groups;
	}
	@SuppressWarnings("unchecked")
	public List<BulkGroup> selectAllActive() {
		List<BulkGroup> groups = null;
		try {
			groups = (List<BulkGroup>) em.createNamedQuery("BulkGroup.findAllActive").getResultList();
		} catch (NoResultException e) {

		}

		return groups;
	}

}
